package com;

import com.mchange.v2.c3p0.ComboPooledDataSource;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;

import javax.sql.DataSource;

/**
 * Created by pengfei on 2017/10/26.
 */
@SpringBootApplication
public class StarterApplication {
    @Bean
    public DataSource ComboPooledDataSource(){
        ComboPooledDataSource dataSource = new ComboPooledDataSource();
        dataSource.setJdbcUrl("jdbc:mysql://localhost:3306/test?verifyServerCertificate=false");
        dataSource.setUser("root");
        dataSource.setPassword("123456");
        return dataSource;
    }
    public static void main(String[] args) {
        SpringApplication.run(StarterApplication.class,args);
    }
}
